<?php include_once "usuariosinfo.php" ?>
<?php

// Create page object
if (!isset($presu_enc_pre_valores_grid)) $presu_enc_pre_valores_grid = new cpresu_enc_pre_valores_grid();

// Page init
$presu_enc_pre_valores_grid->Page_Init();

// Page main
$presu_enc_pre_valores_grid->Page_Main();

// Global Page Rendering event (in userfn*.php)
Page_Rendering();

// Page Rendering event
$presu_enc_pre_valores_grid->Page_Render();
?>
<?php if ($presu_enc_pre_valores->Export == "") { ?>
<script type="text/javascript">

// Page object
var presu_enc_pre_valores_grid = new ew_Page("presu_enc_pre_valores_grid");
presu_enc_pre_valores_grid.PageID = "grid"; // Page ID
var EW_PAGE_ID = presu_enc_pre_valores_grid.PageID; // For backward compatibility

// Form object
var fpresu_enc_pre_valoresgrid = new ew_Form("fpresu_enc_pre_valoresgrid");
fpresu_enc_pre_valoresgrid.FormKeyCountName = '<?php echo $presu_enc_pre_valores_grid->FormKeyCountName ?>';

// Validate form
fpresu_enc_pre_valoresgrid.Validate = function() {
	if (!this.ValidateRequired)
		return true; // Ignore validation
	var $ = jQuery, fobj = this.GetForm(), $fobj = $(fobj);
	this.PostAutoSuggest();
	if ($fobj.find("#a_confirm").val() == "F")
		return true;
	var elm, felm, uelm, addcnt = 0;
	var $k = $fobj.find("#" + this.FormKeyCountName); // Get key_count
	var rowcnt = ($k[0]) ? parseInt($k.val(), 10) : 1;
	var startcnt = (rowcnt == 0) ? 0 : 1; // Check rowcnt == 0 => Inline-Add
	var gridinsert = $fobj.find("#a_list").val() == "gridinsert";
	for (var i = startcnt; i <= rowcnt; i++) {
		var infix = ($k[0]) ? String(i) : "";
		$fobj.data("rowindex", infix);
		var checkrow = (gridinsert) ? !this.EmptyRow(infix) : true;
		if (checkrow) {
			addcnt++;
			elm = this.GetElements("x" + infix + "_ValoresPregunta");
			if (elm && !ew_HasValue(elm))
				return this.OnError(elm, ewLanguage.Phrase("EnterRequiredField") + " - <?php echo ew_JsEncode2($presu_enc_pre_valores->ValoresPregunta->FldCaption()) ?>");
			elm = this.GetElements("x" + infix + "_ValoresPregunta");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($presu_enc_pre_valores->ValoresPregunta->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_Total");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($presu_enc_pre_valores->Total->FldErrMsg()) ?>");

			// Set up row object
			ew_ElementsToRow(fobj);

			// Fire Form_CustomValidate event
			if (!this.Form_CustomValidate(fobj))
				return false;
		} // End Grid Add checking
	}
	return true;
}

// Check empty row
fpresu_enc_pre_valoresgrid.EmptyRow = function(infix) {
	var fobj = this.Form;
	if (ew_ValueChanged(fobj, infix, "ValoresPregunta", false)) return false;
	if (ew_ValueChanged(fobj, infix, "Valor", false)) return false;
	if (ew_ValueChanged(fobj, infix, "Total", false)) return false;
	return true;
}

// Form_CustomValidate event
fpresu_enc_pre_valoresgrid.Form_CustomValidate = 
 function(fobj) { // DO NOT CHANGE THIS LINE!

 	// Your custom validation code here, return false if invalid. 
 	return true;
 }

// Use JavaScript validation or not
<?php if (EW_CLIENT_VALIDATE) { ?>
fpresu_enc_pre_valoresgrid.ValidateRequired = true;
<?php } else { ?>
fpresu_enc_pre_valoresgrid.ValidateRequired = false; 
<?php } ?>

// Dynamic selection lists
fpresu_enc_pre_valoresgrid.Lists["x_ValoresPregunta"] = {"LinkField":"x_PreguntaId","Ajax":true,"AutoFill":false,"DisplayFields":["x_Pregunta","","",""],"ParentFields":[],"FilterFields":[],"Options":[]};

// Form object for search
</script>
<?php } ?>
<?php if ($presu_enc_pre_valores->getCurrentMasterTable() == "" && $presu_enc_pre_valores_grid->ExportOptions->Visible()) { ?>
<div class="ewListExportOptions"><?php $presu_enc_pre_valores_grid->ExportOptions->Render("body") ?></div>
<?php } ?>
<?php
if ($presu_enc_pre_valores->CurrentAction == "gridadd") {
	if ($presu_enc_pre_valores->CurrentMode == "copy") {
		$bSelectLimit = EW_SELECT_LIMIT;
		if ($bSelectLimit) {
			$presu_enc_pre_valores_grid->TotalRecs = $presu_enc_pre_valores->SelectRecordCount();
			$presu_enc_pre_valores_grid->Recordset = $presu_enc_pre_valores_grid->LoadRecordset($presu_enc_pre_valores_grid->StartRec-1, $presu_enc_pre_valores_grid->DisplayRecs);
		} else {
			if ($presu_enc_pre_valores_grid->Recordset = $presu_enc_pre_valores_grid->LoadRecordset())
				$presu_enc_pre_valores_grid->TotalRecs = $presu_enc_pre_valores_grid->Recordset->RecordCount();
		}
		$presu_enc_pre_valores_grid->StartRec = 1;
		$presu_enc_pre_valores_grid->DisplayRecs = $presu_enc_pre_valores_grid->TotalRecs;
	} else {
		$presu_enc_pre_valores->CurrentFilter = "0=1";
		$presu_enc_pre_valores_grid->StartRec = 1;
		$presu_enc_pre_valores_grid->DisplayRecs = $presu_enc_pre_valores->GridAddRowCount;
	}
	$presu_enc_pre_valores_grid->TotalRecs = $presu_enc_pre_valores_grid->DisplayRecs;
	$presu_enc_pre_valores_grid->StopRec = $presu_enc_pre_valores_grid->DisplayRecs;
} else {
	$bSelectLimit = EW_SELECT_LIMIT;
	if ($bSelectLimit) {
		$presu_enc_pre_valores_grid->TotalRecs = $presu_enc_pre_valores->SelectRecordCount();
	} else {
		if ($presu_enc_pre_valores_grid->Recordset = $presu_enc_pre_valores_grid->LoadRecordset())
			$presu_enc_pre_valores_grid->TotalRecs = $presu_enc_pre_valores_grid->Recordset->RecordCount();
	}
	$presu_enc_pre_valores_grid->StartRec = 1;
	$presu_enc_pre_valores_grid->DisplayRecs = $presu_enc_pre_valores_grid->TotalRecs; // Display all records
	if ($bSelectLimit)
		$presu_enc_pre_valores_grid->Recordset = $presu_enc_pre_valores_grid->LoadRecordset($presu_enc_pre_valores_grid->StartRec-1, $presu_enc_pre_valores_grid->DisplayRecs);
}
$presu_enc_pre_valores_grid->RenderOtherOptions();
?>
<?php $presu_enc_pre_valores_grid->ShowPageHeader(); ?>
<?php
$presu_enc_pre_valores_grid->ShowMessage();
?>
<table class="ewGrid"><tr><td class="ewGridContent">
<div id="fpresu_enc_pre_valoresgrid" class="ewForm form-inline">
<div id="gmp_presu_enc_pre_valores" class="ewGridMiddlePanel">
<table id="tbl_presu_enc_pre_valoresgrid" class="ewTable ewTableSeparate">
<?php echo $presu_enc_pre_valores->TableCustomInnerHtml ?>
<thead><!-- Table header -->
	<tr class="ewTableHeader">
<?php

// Render list options
$presu_enc_pre_valores_grid->RenderListOptions();

// Render list options (header, left)
$presu_enc_pre_valores_grid->ListOptions->Render("header", "left");
?>
<?php if ($presu_enc_pre_valores->ValoresId->Visible) { // ValoresId ?>
	<?php if ($presu_enc_pre_valores->SortUrl($presu_enc_pre_valores->ValoresId) == "") { ?>
		<td><div id="elh_presu_enc_pre_valores_ValoresId" class="presu_enc_pre_valores_ValoresId"><div class="ewTableHeaderCaption"><?php echo $presu_enc_pre_valores->ValoresId->FldCaption() ?></div></div></td>
	<?php } else { ?>
		<td><div><div id="elh_presu_enc_pre_valores_ValoresId" class="presu_enc_pre_valores_ValoresId">
			<div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><?php echo $presu_enc_pre_valores->ValoresId->FldCaption() ?></span><span class="ewTableHeaderSort"><?php if ($presu_enc_pre_valores->ValoresId->getSort() == "ASC") { ?><span class="caret ewSortUp"></span><?php } elseif ($presu_enc_pre_valores->ValoresId->getSort() == "DESC") { ?><span class="caret"></span><?php } ?></span></div>
        </div></div></td>
	<?php } ?>
<?php } ?>		
<?php if ($presu_enc_pre_valores->ValoresPregunta->Visible) { // ValoresPregunta ?>
	<?php if ($presu_enc_pre_valores->SortUrl($presu_enc_pre_valores->ValoresPregunta) == "") { ?>
		<td><div id="elh_presu_enc_pre_valores_ValoresPregunta" class="presu_enc_pre_valores_ValoresPregunta"><div class="ewTableHeaderCaption"><?php echo $presu_enc_pre_valores->ValoresPregunta->FldCaption() ?></div></div></td>
	<?php } else { ?>
		<td><div><div id="elh_presu_enc_pre_valores_ValoresPregunta" class="presu_enc_pre_valores_ValoresPregunta">
			<div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><?php echo $presu_enc_pre_valores->ValoresPregunta->FldCaption() ?></span><span class="ewTableHeaderSort"><?php if ($presu_enc_pre_valores->ValoresPregunta->getSort() == "ASC") { ?><span class="caret ewSortUp"></span><?php } elseif ($presu_enc_pre_valores->ValoresPregunta->getSort() == "DESC") { ?><span class="caret"></span><?php } ?></span></div>
        </div></div></td>
	<?php } ?>
<?php } ?>		
<?php if ($presu_enc_pre_valores->Valor->Visible) { // Valor ?>
	<?php if ($presu_enc_pre_valores->SortUrl($presu_enc_pre_valores->Valor) == "") { ?>
		<td><div id="elh_presu_enc_pre_valores_Valor" class="presu_enc_pre_valores_Valor"><div class="ewTableHeaderCaption"><?php echo $presu_enc_pre_valores->Valor->FldCaption() ?></div></div></td>
	<?php } else { ?>
		<td><div><div id="elh_presu_enc_pre_valores_Valor" class="presu_enc_pre_valores_Valor">
			<div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><?php echo $presu_enc_pre_valores->Valor->FldCaption() ?></span><span class="ewTableHeaderSort"><?php if ($presu_enc_pre_valores->Valor->getSort() == "ASC") { ?><span class="caret ewSortUp"></span><?php } elseif ($presu_enc_pre_valores->Valor->getSort() == "DESC") { ?><span class="caret"></span><?php } ?></span></div>
        </div></div></td>
	<?php } ?>
<?php } ?>		
<?php if ($presu_enc_pre_valores->Total->Visible) { // Total ?>
	<?php if ($presu_enc_pre_valores->SortUrl($presu_enc_pre_valores->Total) == "") { ?>
		<td><div id="elh_presu_enc_pre_valores_Total" class="presu_enc_pre_valores_Total"><div class="ewTableHeaderCaption"><?php echo $presu_enc_pre_valores->Total->FldCaption() ?></div></div></td>
	<?php } else { ?>
		<td><div><div id="elh_presu_enc_pre_valores_Total" class="presu_enc_pre_valores_Total">
			<div class="ewTableHeaderBtn"><span class="ewTableHeaderCaption"><?php echo $presu_enc_pre_valores->Total->FldCaption() ?></span><span class="ewTableHeaderSort"><?php if ($presu_enc_pre_valores->Total->getSort() == "ASC") { ?><span class="caret ewSortUp"></span><?php } elseif ($presu_enc_pre_valores->Total->getSort() == "DESC") { ?><span class="caret"></span><?php } ?></span></div>
        </div></div></td>
	<?php } ?>
<?php } ?>		
<?php

// Render list options (header, right)
$presu_enc_pre_valores_grid->ListOptions->Render("header", "right");
?>
	</tr>
</thead>
<tbody>
<?php
$presu_enc_pre_valores_grid->StartRec = 1;
$presu_enc_pre_valores_grid->StopRec = $presu_enc_pre_valores_grid->TotalRecs; // Show all records

// Restore number of post back records
if ($objForm) {
	$objForm->Index = -1;
	if ($objForm->HasValue($presu_enc_pre_valores_grid->FormKeyCountName) && ($presu_enc_pre_valores->CurrentAction == "gridadd" || $presu_enc_pre_valores->CurrentAction == "gridedit" || $presu_enc_pre_valores->CurrentAction == "F")) {
		$presu_enc_pre_valores_grid->KeyCount = $objForm->GetValue($presu_enc_pre_valores_grid->FormKeyCountName);
		$presu_enc_pre_valores_grid->StopRec = $presu_enc_pre_valores_grid->StartRec + $presu_enc_pre_valores_grid->KeyCount - 1;
	}
}
$presu_enc_pre_valores_grid->RecCnt = $presu_enc_pre_valores_grid->StartRec - 1;
if ($presu_enc_pre_valores_grid->Recordset && !$presu_enc_pre_valores_grid->Recordset->EOF) {
	$presu_enc_pre_valores_grid->Recordset->MoveFirst();
	if (!$bSelectLimit && $presu_enc_pre_valores_grid->StartRec > 1)
		$presu_enc_pre_valores_grid->Recordset->Move($presu_enc_pre_valores_grid->StartRec - 1);
} elseif (!$presu_enc_pre_valores->AllowAddDeleteRow && $presu_enc_pre_valores_grid->StopRec == 0) {
	$presu_enc_pre_valores_grid->StopRec = $presu_enc_pre_valores->GridAddRowCount;
}

// Initialize aggregate
$presu_enc_pre_valores->RowType = EW_ROWTYPE_AGGREGATEINIT;
$presu_enc_pre_valores->ResetAttrs();
$presu_enc_pre_valores_grid->RenderRow();
if ($presu_enc_pre_valores->CurrentAction == "gridadd")
	$presu_enc_pre_valores_grid->RowIndex = 0;
if ($presu_enc_pre_valores->CurrentAction == "gridedit")
	$presu_enc_pre_valores_grid->RowIndex = 0;
while ($presu_enc_pre_valores_grid->RecCnt < $presu_enc_pre_valores_grid->StopRec) {
	$presu_enc_pre_valores_grid->RecCnt++;
	if (intval($presu_enc_pre_valores_grid->RecCnt) >= intval($presu_enc_pre_valores_grid->StartRec)) {
		$presu_enc_pre_valores_grid->RowCnt++;
		if ($presu_enc_pre_valores->CurrentAction == "gridadd" || $presu_enc_pre_valores->CurrentAction == "gridedit" || $presu_enc_pre_valores->CurrentAction == "F") {
			$presu_enc_pre_valores_grid->RowIndex++;
			$objForm->Index = $presu_enc_pre_valores_grid->RowIndex;
			if ($objForm->HasValue($presu_enc_pre_valores_grid->FormActionName))
				$presu_enc_pre_valores_grid->RowAction = strval($objForm->GetValue($presu_enc_pre_valores_grid->FormActionName));
			elseif ($presu_enc_pre_valores->CurrentAction == "gridadd")
				$presu_enc_pre_valores_grid->RowAction = "insert";
			else
				$presu_enc_pre_valores_grid->RowAction = "";
		}

		// Set up key count
		$presu_enc_pre_valores_grid->KeyCount = $presu_enc_pre_valores_grid->RowIndex;

		// Init row class and style
		$presu_enc_pre_valores->ResetAttrs();
		$presu_enc_pre_valores->CssClass = "";
		if ($presu_enc_pre_valores->CurrentAction == "gridadd") {
			if ($presu_enc_pre_valores->CurrentMode == "copy") {
				$presu_enc_pre_valores_grid->LoadRowValues($presu_enc_pre_valores_grid->Recordset); // Load row values
				$presu_enc_pre_valores_grid->SetRecordKey($presu_enc_pre_valores_grid->RowOldKey, $presu_enc_pre_valores_grid->Recordset); // Set old record key
			} else {
				$presu_enc_pre_valores_grid->LoadDefaultValues(); // Load default values
				$presu_enc_pre_valores_grid->RowOldKey = ""; // Clear old key value
			}
		} else {
			$presu_enc_pre_valores_grid->LoadRowValues($presu_enc_pre_valores_grid->Recordset); // Load row values
		}
		$presu_enc_pre_valores->RowType = EW_ROWTYPE_VIEW; // Render view
		if ($presu_enc_pre_valores->CurrentAction == "gridadd") // Grid add
			$presu_enc_pre_valores->RowType = EW_ROWTYPE_ADD; // Render add
		if ($presu_enc_pre_valores->CurrentAction == "gridadd" && $presu_enc_pre_valores->EventCancelled && !$objForm->HasValue("k_blankrow")) // Insert failed
			$presu_enc_pre_valores_grid->RestoreCurrentRowFormValues($presu_enc_pre_valores_grid->RowIndex); // Restore form values
		if ($presu_enc_pre_valores->CurrentAction == "gridedit") { // Grid edit
			if ($presu_enc_pre_valores->EventCancelled) {
				$presu_enc_pre_valores_grid->RestoreCurrentRowFormValues($presu_enc_pre_valores_grid->RowIndex); // Restore form values
			}
			if ($presu_enc_pre_valores_grid->RowAction == "insert")
				$presu_enc_pre_valores->RowType = EW_ROWTYPE_ADD; // Render add
			else
				$presu_enc_pre_valores->RowType = EW_ROWTYPE_EDIT; // Render edit
		}
		if ($presu_enc_pre_valores->CurrentAction == "gridedit" && ($presu_enc_pre_valores->RowType == EW_ROWTYPE_EDIT || $presu_enc_pre_valores->RowType == EW_ROWTYPE_ADD) && $presu_enc_pre_valores->EventCancelled) // Update failed
			$presu_enc_pre_valores_grid->RestoreCurrentRowFormValues($presu_enc_pre_valores_grid->RowIndex); // Restore form values
		if ($presu_enc_pre_valores->RowType == EW_ROWTYPE_EDIT) // Edit row
			$presu_enc_pre_valores_grid->EditRowCnt++;
		if ($presu_enc_pre_valores->CurrentAction == "F") // Confirm row
			$presu_enc_pre_valores_grid->RestoreCurrentRowFormValues($presu_enc_pre_valores_grid->RowIndex); // Restore form values

		// Set up row id / data-rowindex
		$presu_enc_pre_valores->RowAttrs = array_merge($presu_enc_pre_valores->RowAttrs, array('data-rowindex'=>$presu_enc_pre_valores_grid->RowCnt, 'id'=>'r' . $presu_enc_pre_valores_grid->RowCnt . '_presu_enc_pre_valores', 'data-rowtype'=>$presu_enc_pre_valores->RowType));

		// Render row
		$presu_enc_pre_valores_grid->RenderRow();

		// Render list options
		$presu_enc_pre_valores_grid->RenderListOptions();

		// Skip delete row / empty row for confirm page
		if ($presu_enc_pre_valores_grid->RowAction <> "delete" && $presu_enc_pre_valores_grid->RowAction <> "insertdelete" && !($presu_enc_pre_valores_grid->RowAction == "insert" && $presu_enc_pre_valores->CurrentAction == "F" && $presu_enc_pre_valores_grid->EmptyRow())) {
?>
	<tr<?php echo $presu_enc_pre_valores->RowAttributes() ?>>
<?php

// Render list options (body, left)
$presu_enc_pre_valores_grid->ListOptions->Render("body", "left", $presu_enc_pre_valores_grid->RowCnt);
?>
	<?php if ($presu_enc_pre_valores->ValoresId->Visible) { // ValoresId ?>
		<td<?php echo $presu_enc_pre_valores->ValoresId->CellAttributes() ?>>
<?php if ($presu_enc_pre_valores->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="hidden" data-field="x_ValoresId" name="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresId" id="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresId" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresId->OldValue) ?>">
<?php } ?>
<?php if ($presu_enc_pre_valores->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $presu_enc_pre_valores_grid->RowCnt ?>_presu_enc_pre_valores_ValoresId" class="control-group presu_enc_pre_valores_ValoresId">
<span<?php echo $presu_enc_pre_valores->ValoresId->ViewAttributes() ?>>
<?php echo $presu_enc_pre_valores->ValoresId->EditValue ?></span>
</span>
<input type="hidden" data-field="x_ValoresId" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresId" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresId" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresId->CurrentValue) ?>">
<?php } ?>
<?php if ($presu_enc_pre_valores->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<span<?php echo $presu_enc_pre_valores->ValoresId->ViewAttributes() ?>>
<?php echo $presu_enc_pre_valores->ValoresId->ListViewValue() ?></span>
<input type="hidden" data-field="x_ValoresId" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresId" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresId" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresId->FormValue) ?>">
<input type="hidden" data-field="x_ValoresId" name="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresId" id="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresId" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresId->OldValue) ?>">
<?php } ?>
<a id="<?php echo $presu_enc_pre_valores_grid->PageObjName . "_row_" . $presu_enc_pre_valores_grid->RowCnt ?>"></a></td>
	<?php } ?>
	<?php if ($presu_enc_pre_valores->ValoresPregunta->Visible) { // ValoresPregunta ?>
		<td<?php echo $presu_enc_pre_valores->ValoresPregunta->CellAttributes() ?>>
<?php if ($presu_enc_pre_valores->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<?php if ($presu_enc_pre_valores->ValoresPregunta->getSessionValue() <> "") { ?>
<span<?php echo $presu_enc_pre_valores->ValoresPregunta->ViewAttributes() ?>>
<?php echo $presu_enc_pre_valores->ValoresPregunta->ListViewValue() ?></span>
<input type="hidden" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresPregunta->CurrentValue) ?>">
<?php } else { ?>
<?php
	$wrkonchange = trim(" " . @$presu_enc_pre_valores->ValoresPregunta->EditAttrs["onchange"]);
	if ($wrkonchange <> "") $wrkonchange = " onchange=\"" . ew_JsEncode2($wrkonchange) . "\"";
	$presu_enc_pre_valores->ValoresPregunta->EditAttrs["onchange"] = "";
?>
<span id="as_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" style="white-space: nowrap; z-index: <?php echo (9000 - $presu_enc_pre_valores_grid->RowCnt * 10) ?>">
	<input type="text" name="sv_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" id="sv_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="<?php echo $presu_enc_pre_valores->ValoresPregunta->EditValue ?>" size="30" placeholder="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresPregunta->PlaceHolder) ?>"<?php echo $presu_enc_pre_valores->ValoresPregunta->EditAttributes() ?>>&nbsp;<span id="em_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" class="ewMessage" style="display: none"><?php echo str_replace("%f", "phpimages/", $Language->Phrase("UnmatchedValue")) ?></span>
	<div id="sc_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" style="display: inline; z-index: <?php echo (9000 - $presu_enc_pre_valores_grid->RowCnt * 10) ?>"></div>
</span>
<input type="hidden" data-field="x_ValoresPregunta" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresPregunta->CurrentValue) ?>"<?php echo $wrkonchange ?>>
<?php
 $sSqlWrk = "SELECT `PreguntaId`, `Pregunta` AS `DispFld` FROM `presu_enc_preguntas`";
 $sWhereWrk = "`Pregunta` LIKE '{query_value}%'";

 // Call Lookup selecting
 $presu_enc_pre_valores->Lookup_Selecting($presu_enc_pre_valores->ValoresPregunta, $sWhereWrk);
 if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
 $sSqlWrk .= " LIMIT " . EW_AUTO_SUGGEST_MAX_ENTRIES;
?>
<input type="hidden" name="q_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" id="q_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="s=<?php echo ew_Encrypt($sSqlWrk) ?>">
<script type="text/javascript">
var oas = new ew_AutoSuggest("x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta", fpresu_enc_pre_valoresgrid, true, EW_AUTO_SUGGEST_MAX_ENTRIES);
oas.formatResult = function(ar) {
	var dv = ar[1];
	for (var i = 2; i <= 4; i++)
		dv += (ar[i]) ? ew_ValueSeparator(i - 1, "x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta") + ar[i] : "";
	return dv;
}
fpresu_enc_pre_valoresgrid.AutoSuggests["x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta"] = oas;
</script>
<?php } ?>
<input type="hidden" data-field="x_ValoresPregunta" name="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" id="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresPregunta->OldValue) ?>">
<?php } ?>
<?php if ($presu_enc_pre_valores->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<?php if ($presu_enc_pre_valores->ValoresPregunta->getSessionValue() <> "") { ?>
<span<?php echo $presu_enc_pre_valores->ValoresPregunta->ViewAttributes() ?>>
<?php echo $presu_enc_pre_valores->ValoresPregunta->ListViewValue() ?></span>
<input type="hidden" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresPregunta->CurrentValue) ?>">
<?php } else { ?>
<?php
	$wrkonchange = trim(" " . @$presu_enc_pre_valores->ValoresPregunta->EditAttrs["onchange"]);
	if ($wrkonchange <> "") $wrkonchange = " onchange=\"" . ew_JsEncode2($wrkonchange) . "\"";
	$presu_enc_pre_valores->ValoresPregunta->EditAttrs["onchange"] = "";
?>
<span id="as_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" style="white-space: nowrap; z-index: <?php echo (9000 - $presu_enc_pre_valores_grid->RowCnt * 10) ?>">
	<input type="text" name="sv_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" id="sv_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="<?php echo $presu_enc_pre_valores->ValoresPregunta->EditValue ?>" size="30" placeholder="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresPregunta->PlaceHolder) ?>"<?php echo $presu_enc_pre_valores->ValoresPregunta->EditAttributes() ?>>&nbsp;<span id="em_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" class="ewMessage" style="display: none"><?php echo str_replace("%f", "phpimages/", $Language->Phrase("UnmatchedValue")) ?></span>
	<div id="sc_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" style="display: inline; z-index: <?php echo (9000 - $presu_enc_pre_valores_grid->RowCnt * 10) ?>"></div>
</span>
<input type="hidden" data-field="x_ValoresPregunta" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresPregunta->CurrentValue) ?>"<?php echo $wrkonchange ?>>
<?php
 $sSqlWrk = "SELECT `PreguntaId`, `Pregunta` AS `DispFld` FROM `presu_enc_preguntas`";
 $sWhereWrk = "`Pregunta` LIKE '{query_value}%'";

 // Call Lookup selecting
 $presu_enc_pre_valores->Lookup_Selecting($presu_enc_pre_valores->ValoresPregunta, $sWhereWrk);
 if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
 $sSqlWrk .= " LIMIT " . EW_AUTO_SUGGEST_MAX_ENTRIES;
?>
<input type="hidden" name="q_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" id="q_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="s=<?php echo ew_Encrypt($sSqlWrk) ?>">
<script type="text/javascript">
var oas = new ew_AutoSuggest("x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta", fpresu_enc_pre_valoresgrid, true, EW_AUTO_SUGGEST_MAX_ENTRIES);
oas.formatResult = function(ar) {
	var dv = ar[1];
	for (var i = 2; i <= 4; i++)
		dv += (ar[i]) ? ew_ValueSeparator(i - 1, "x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta") + ar[i] : "";
	return dv;
}
fpresu_enc_pre_valoresgrid.AutoSuggests["x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta"] = oas;
</script>
<?php } ?>
<?php } ?>
<?php if ($presu_enc_pre_valores->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<span<?php echo $presu_enc_pre_valores->ValoresPregunta->ViewAttributes() ?>>
<?php echo $presu_enc_pre_valores->ValoresPregunta->ListViewValue() ?></span>
<input type="hidden" data-field="x_ValoresPregunta" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresPregunta->FormValue) ?>">
<input type="hidden" data-field="x_ValoresPregunta" name="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" id="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresPregunta->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($presu_enc_pre_valores->Valor->Visible) { // Valor ?>
		<td<?php echo $presu_enc_pre_valores->Valor->CellAttributes() ?>>
<?php if ($presu_enc_pre_valores->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $presu_enc_pre_valores_grid->RowCnt ?>_presu_enc_pre_valores_Valor" class="control-group presu_enc_pre_valores_Valor">
<input type="text" data-field="x_Valor" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Valor" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Valor" size="30" maxlength="50" placeholder="<?php echo ew_HtmlEncode($presu_enc_pre_valores->Valor->PlaceHolder) ?>" value="<?php echo $presu_enc_pre_valores->Valor->EditValue ?>"<?php echo $presu_enc_pre_valores->Valor->EditAttributes() ?>>
</span>
<input type="hidden" data-field="x_Valor" name="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Valor" id="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Valor" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->Valor->OldValue) ?>">
<?php } ?>
<?php if ($presu_enc_pre_valores->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $presu_enc_pre_valores_grid->RowCnt ?>_presu_enc_pre_valores_Valor" class="control-group presu_enc_pre_valores_Valor">
<input type="text" data-field="x_Valor" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Valor" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Valor" size="30" maxlength="50" placeholder="<?php echo ew_HtmlEncode($presu_enc_pre_valores->Valor->PlaceHolder) ?>" value="<?php echo $presu_enc_pre_valores->Valor->EditValue ?>"<?php echo $presu_enc_pre_valores->Valor->EditAttributes() ?>>
</span>
<?php } ?>
<?php if ($presu_enc_pre_valores->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<span<?php echo $presu_enc_pre_valores->Valor->ViewAttributes() ?>>
<?php echo $presu_enc_pre_valores->Valor->ListViewValue() ?></span>
<input type="hidden" data-field="x_Valor" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Valor" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Valor" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->Valor->FormValue) ?>">
<input type="hidden" data-field="x_Valor" name="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Valor" id="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Valor" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->Valor->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($presu_enc_pre_valores->Total->Visible) { // Total ?>
		<td<?php echo $presu_enc_pre_valores->Total->CellAttributes() ?>>
<?php if ($presu_enc_pre_valores->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $presu_enc_pre_valores_grid->RowCnt ?>_presu_enc_pre_valores_Total" class="control-group presu_enc_pre_valores_Total">
<input type="text" data-field="x_Total" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Total" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Total" size="30" placeholder="<?php echo ew_HtmlEncode($presu_enc_pre_valores->Total->PlaceHolder) ?>" value="<?php echo $presu_enc_pre_valores->Total->EditValue ?>"<?php echo $presu_enc_pre_valores->Total->EditAttributes() ?>>
</span>
<input type="hidden" data-field="x_Total" name="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Total" id="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Total" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->Total->OldValue) ?>">
<?php } ?>
<?php if ($presu_enc_pre_valores->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $presu_enc_pre_valores_grid->RowCnt ?>_presu_enc_pre_valores_Total" class="control-group presu_enc_pre_valores_Total">
<input type="text" data-field="x_Total" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Total" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Total" size="30" placeholder="<?php echo ew_HtmlEncode($presu_enc_pre_valores->Total->PlaceHolder) ?>" value="<?php echo $presu_enc_pre_valores->Total->EditValue ?>"<?php echo $presu_enc_pre_valores->Total->EditAttributes() ?>>
</span>
<?php } ?>
<?php if ($presu_enc_pre_valores->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<span<?php echo $presu_enc_pre_valores->Total->ViewAttributes() ?>>
<?php echo $presu_enc_pre_valores->Total->ListViewValue() ?></span>
<input type="hidden" data-field="x_Total" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Total" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Total" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->Total->FormValue) ?>">
<input type="hidden" data-field="x_Total" name="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Total" id="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Total" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->Total->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$presu_enc_pre_valores_grid->ListOptions->Render("body", "right", $presu_enc_pre_valores_grid->RowCnt);
?>
	</tr>
<?php if ($presu_enc_pre_valores->RowType == EW_ROWTYPE_ADD || $presu_enc_pre_valores->RowType == EW_ROWTYPE_EDIT) { ?>
<script type="text/javascript">
fpresu_enc_pre_valoresgrid.UpdateOpts(<?php echo $presu_enc_pre_valores_grid->RowIndex ?>);
</script>
<?php } ?>
<?php
	}
	} // End delete row checking
	if ($presu_enc_pre_valores->CurrentAction <> "gridadd" || $presu_enc_pre_valores->CurrentMode == "copy")
		if (!$presu_enc_pre_valores_grid->Recordset->EOF) $presu_enc_pre_valores_grid->Recordset->MoveNext();
}
?>
<?php
	if ($presu_enc_pre_valores->CurrentMode == "add" || $presu_enc_pre_valores->CurrentMode == "copy" || $presu_enc_pre_valores->CurrentMode == "edit") {
		$presu_enc_pre_valores_grid->RowIndex = '$rowindex$';
		$presu_enc_pre_valores_grid->LoadDefaultValues();

		// Set row properties
		$presu_enc_pre_valores->ResetAttrs();
		$presu_enc_pre_valores->RowAttrs = array_merge($presu_enc_pre_valores->RowAttrs, array('data-rowindex'=>$presu_enc_pre_valores_grid->RowIndex, 'id'=>'r0_presu_enc_pre_valores', 'data-rowtype'=>EW_ROWTYPE_ADD));
		ew_AppendClass($presu_enc_pre_valores->RowAttrs["class"], "ewTemplate");
		$presu_enc_pre_valores->RowType = EW_ROWTYPE_ADD;

		// Render row
		$presu_enc_pre_valores_grid->RenderRow();

		// Render list options
		$presu_enc_pre_valores_grid->RenderListOptions();
		$presu_enc_pre_valores_grid->StartRowCnt = 0;
?>
	<tr<?php echo $presu_enc_pre_valores->RowAttributes() ?>>
<?php

// Render list options (body, left)
$presu_enc_pre_valores_grid->ListOptions->Render("body", "left", $presu_enc_pre_valores_grid->RowIndex);
?>
	<?php if ($presu_enc_pre_valores->ValoresId->Visible) { // ValoresId ?>
		<td>
<?php if ($presu_enc_pre_valores->CurrentAction <> "F") { ?>
<?php } else { ?>
<span id="el$rowindex$_presu_enc_pre_valores_ValoresId" class="control-group presu_enc_pre_valores_ValoresId">
<span<?php echo $presu_enc_pre_valores->ValoresId->ViewAttributes() ?>>
<?php echo $presu_enc_pre_valores->ValoresId->ViewValue ?></span>
</span>
<input type="hidden" data-field="x_ValoresId" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresId" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresId" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresId->FormValue) ?>">
<?php } ?>
<input type="hidden" data-field="x_ValoresId" name="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresId" id="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresId" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresId->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($presu_enc_pre_valores->ValoresPregunta->Visible) { // ValoresPregunta ?>
		<td>
<?php if ($presu_enc_pre_valores->CurrentAction <> "F") { ?>
<?php if ($presu_enc_pre_valores->ValoresPregunta->getSessionValue() <> "") { ?>
<span<?php echo $presu_enc_pre_valores->ValoresPregunta->ViewAttributes() ?>>
<?php echo $presu_enc_pre_valores->ValoresPregunta->ListViewValue() ?></span>
<input type="hidden" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresPregunta->CurrentValue) ?>">
<?php } else { ?>
<?php
	$wrkonchange = trim(" " . @$presu_enc_pre_valores->ValoresPregunta->EditAttrs["onchange"]);
	if ($wrkonchange <> "") $wrkonchange = " onchange=\"" . ew_JsEncode2($wrkonchange) . "\"";
	$presu_enc_pre_valores->ValoresPregunta->EditAttrs["onchange"] = "";
?>
<span id="as_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" style="white-space: nowrap; z-index: <?php echo (9000 - $presu_enc_pre_valores_grid->RowCnt * 10) ?>">
	<input type="text" name="sv_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" id="sv_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="<?php echo $presu_enc_pre_valores->ValoresPregunta->EditValue ?>" size="30" placeholder="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresPregunta->PlaceHolder) ?>"<?php echo $presu_enc_pre_valores->ValoresPregunta->EditAttributes() ?>>&nbsp;<span id="em_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" class="ewMessage" style="display: none"><?php echo str_replace("%f", "phpimages/", $Language->Phrase("UnmatchedValue")) ?></span>
	<div id="sc_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" style="display: inline; z-index: <?php echo (9000 - $presu_enc_pre_valores_grid->RowCnt * 10) ?>"></div>
</span>
<input type="hidden" data-field="x_ValoresPregunta" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresPregunta->CurrentValue) ?>"<?php echo $wrkonchange ?>>
<?php
 $sSqlWrk = "SELECT `PreguntaId`, `Pregunta` AS `DispFld` FROM `presu_enc_preguntas`";
 $sWhereWrk = "`Pregunta` LIKE '{query_value}%'";

 // Call Lookup selecting
 $presu_enc_pre_valores->Lookup_Selecting($presu_enc_pre_valores->ValoresPregunta, $sWhereWrk);
 if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
 $sSqlWrk .= " LIMIT " . EW_AUTO_SUGGEST_MAX_ENTRIES;
?>
<input type="hidden" name="q_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" id="q_x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="s=<?php echo ew_Encrypt($sSqlWrk) ?>">
<script type="text/javascript">
var oas = new ew_AutoSuggest("x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta", fpresu_enc_pre_valoresgrid, true, EW_AUTO_SUGGEST_MAX_ENTRIES);
oas.formatResult = function(ar) {
	var dv = ar[1];
	for (var i = 2; i <= 4; i++)
		dv += (ar[i]) ? ew_ValueSeparator(i - 1, "x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta") + ar[i] : "";
	return dv;
}
fpresu_enc_pre_valoresgrid.AutoSuggests["x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta"] = oas;
</script>
<?php } ?>
<?php } else { ?>
<span<?php echo $presu_enc_pre_valores->ValoresPregunta->ViewAttributes() ?>>
<?php echo $presu_enc_pre_valores->ValoresPregunta->ViewValue ?></span>
<input type="hidden" data-field="x_ValoresPregunta" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresPregunta->FormValue) ?>">
<?php } ?>
<input type="hidden" data-field="x_ValoresPregunta" name="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" id="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_ValoresPregunta" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->ValoresPregunta->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($presu_enc_pre_valores->Valor->Visible) { // Valor ?>
		<td>
<?php if ($presu_enc_pre_valores->CurrentAction <> "F") { ?>
<span id="el$rowindex$_presu_enc_pre_valores_Valor" class="control-group presu_enc_pre_valores_Valor">
<input type="text" data-field="x_Valor" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Valor" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Valor" size="30" maxlength="50" placeholder="<?php echo ew_HtmlEncode($presu_enc_pre_valores->Valor->PlaceHolder) ?>" value="<?php echo $presu_enc_pre_valores->Valor->EditValue ?>"<?php echo $presu_enc_pre_valores->Valor->EditAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_presu_enc_pre_valores_Valor" class="control-group presu_enc_pre_valores_Valor">
<span<?php echo $presu_enc_pre_valores->Valor->ViewAttributes() ?>>
<?php echo $presu_enc_pre_valores->Valor->ViewValue ?></span>
</span>
<input type="hidden" data-field="x_Valor" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Valor" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Valor" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->Valor->FormValue) ?>">
<?php } ?>
<input type="hidden" data-field="x_Valor" name="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Valor" id="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Valor" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->Valor->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($presu_enc_pre_valores->Total->Visible) { // Total ?>
		<td>
<?php if ($presu_enc_pre_valores->CurrentAction <> "F") { ?>
<span id="el$rowindex$_presu_enc_pre_valores_Total" class="control-group presu_enc_pre_valores_Total">
<input type="text" data-field="x_Total" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Total" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Total" size="30" placeholder="<?php echo ew_HtmlEncode($presu_enc_pre_valores->Total->PlaceHolder) ?>" value="<?php echo $presu_enc_pre_valores->Total->EditValue ?>"<?php echo $presu_enc_pre_valores->Total->EditAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_presu_enc_pre_valores_Total" class="control-group presu_enc_pre_valores_Total">
<span<?php echo $presu_enc_pre_valores->Total->ViewAttributes() ?>>
<?php echo $presu_enc_pre_valores->Total->ViewValue ?></span>
</span>
<input type="hidden" data-field="x_Total" name="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Total" id="x<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Total" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->Total->FormValue) ?>">
<?php } ?>
<input type="hidden" data-field="x_Total" name="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Total" id="o<?php echo $presu_enc_pre_valores_grid->RowIndex ?>_Total" value="<?php echo ew_HtmlEncode($presu_enc_pre_valores->Total->OldValue) ?>">
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$presu_enc_pre_valores_grid->ListOptions->Render("body", "right", $presu_enc_pre_valores_grid->RowCnt);
?>
<script type="text/javascript">
fpresu_enc_pre_valoresgrid.UpdateOpts(<?php echo $presu_enc_pre_valores_grid->RowIndex ?>);
</script>
	</tr>
<?php
}
?>
</tbody>
</table>
<?php if ($presu_enc_pre_valores->CurrentMode == "add" || $presu_enc_pre_valores->CurrentMode == "copy") { ?>
<input type="hidden" name="a_list" id="a_list" value="gridinsert">
<input type="hidden" name="<?php echo $presu_enc_pre_valores_grid->FormKeyCountName ?>" id="<?php echo $presu_enc_pre_valores_grid->FormKeyCountName ?>" value="<?php echo $presu_enc_pre_valores_grid->KeyCount ?>">
<?php echo $presu_enc_pre_valores_grid->MultiSelectKey ?>
<?php } ?>
<?php if ($presu_enc_pre_valores->CurrentMode == "edit") { ?>
<input type="hidden" name="a_list" id="a_list" value="gridupdate">
<input type="hidden" name="<?php echo $presu_enc_pre_valores_grid->FormKeyCountName ?>" id="<?php echo $presu_enc_pre_valores_grid->FormKeyCountName ?>" value="<?php echo $presu_enc_pre_valores_grid->KeyCount ?>">
<?php echo $presu_enc_pre_valores_grid->MultiSelectKey ?>
<?php } ?>
<?php if ($presu_enc_pre_valores->CurrentMode == "") { ?>
<input type="hidden" name="a_list" id="a_list" value="">
<?php } ?>
<input type="hidden" name="detailpage" value="fpresu_enc_pre_valoresgrid">
</div>
<?php

// Close recordset
if ($presu_enc_pre_valores_grid->Recordset)
	$presu_enc_pre_valores_grid->Recordset->Close();
?>
<?php if ($presu_enc_pre_valores_grid->ShowOtherOptions) { ?>
<div class="ewGridLowerPanel ewListOtherOptions">
<?php
	foreach ($presu_enc_pre_valores_grid->OtherOptions as &$option)
		$option->Render("body", "bottom");
?>
</div>
<?php } ?>
</div>
</td></tr></table>
<?php if ($presu_enc_pre_valores->Export == "") { ?>
<script type="text/javascript">
fpresu_enc_pre_valoresgrid.Init();
<?php if (EW_MOBILE_REFLOW && ew_IsMobile()) { ?>
ew_Reflow();
<?php } ?>
</script>
<?php } ?>
<?php
$presu_enc_pre_valores_grid->ShowPageFooter();
if (EW_DEBUG_ENABLED)
	echo ew_DebugMsg();
?>
<?php
$presu_enc_pre_valores_grid->Page_Terminate();
?>
